<%@ page language="java" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<title>金保联档案管理系统</title>
<jsp:include page="../inc/easyui.jsp"></jsp:include>
<jsp:include page="../inc/easyui-portal.jsp"></jsp:include>
<link href="../css/table.css" rel="stylesheet" type="text/css" />
<link rel="icon" href="../image/toplogo.png" type="image/x-icon"/>
<link rel="shortcut icon" href="../image/toplogo.png" />
</head>
<script type="text/javascript" charset="utf-8">
var $pagenum = 1;
var admin_dagl_searchForm = undefined;
$(function() {
	admin_dagl_searchForm = $('#admin_dagl_searchForm').form();
	  $("#admin_dagl_searchButton").bind('click', function(){   
		  admin_dagl_search(); 
	    }); 
	  $("#admin_dagl_CleanSearchButton").bind('click', function(){   
		  admin_dagl_cleanSearch();
    }); 
	
	admin_dagl_search();
});
function daglHref(_xgId){
	var url1 = '${pageContext.request.contextPath}/admin/dyda.jsp?xmXgId='+_xgId;
	window.open (url1,'newwindow1');	
}
function daglHref1(){
	$.messager.show({
		msg : "箱柜信息为空!",
		title : '提示',
	});
}	
function admin_dagl_search(pagenum) {
	var bool = true;
	var $page = $('#page').val();
	if(undefined == pagenum || null == pagenum || pagenum == ""){
		$pagenum = 1;
	}
	
	if(pagenum==1){
		if($pagenum >= $page){
			$.messager.show({
				msg : "已经是最后一页了!",
				title : '提示',
			});
			bool = false;
		}else{
			pagenum = ++$pagenum;
		}
	}else if(pagenum==2){
		if($pagenum <= 1){
			$.messager.show({
				msg : "已经是第一页了!",
				title : '提示',
			});
			bool = false;
		}else{
			pagenum = --$pagenum;
		}
	}else{
		pagenum = $pagenum;
	}
	if(bool){
	$("#admin_dagl1_div").html("");
		$.post('${pageContext.request.contextPath}/countTdaAction!getCountData.action?hjId='+$('#numberID').val()+'&page='+pagenum, function(data){
			
			var jsondatas = eval("("+data+")"); 
			var j = 1;
			$('#page').val(jsondatas.total);
			if(null != jsondatas.obj){
				$("#admin_dagl_hj_datagrid").html("");
				var trString = "<tr>";
				trString += "<td>&nbsp;&nbsp;所属库房:</td>";
				trString += "<td>"+jsondatas.obj.tkf.name+"</td>";
				trString += "<td>&nbsp;&nbsp;库房编号:</td>";
				trString += "<td>"+jsondatas.obj.tkf.numberID+"</td>";
				trString += "<td>&nbsp;&nbsp;货架编号:</td>";
				trString += "<td>"+jsondatas.obj.numberID+"</td>";
				trString += "<td>&nbsp;&nbsp;货架名称:</td>";
				trString += "<td>"+jsondatas.obj.name+"</td>";
				trString += "<td>&nbsp;&nbsp;创建时间:</td>";
				trString += "<td>"+jsondatas.obj.cjsj+"</td>";
				trString += "<td>&nbsp;&nbsp;备注:</td>";
				trString += "<td>"+jsondatas.obj.bz+"</td>";
				
				trString += "<td stlye='color:red;'>&nbsp;&nbsp;共&nbsp;"+$('#page').val()+"&nbsp;页>&nbsp;&nbsp;第&nbsp;"+$pagenum+"&nbsp;页</td>";
			
				trString += "</tr>";
				$("#admin_dagl_hj_datagrid").append(trString).show();
			
			}
			if(null != jsondatas.rows){
			$.each(jsondatas.rows,function(i,countTda){  
				var newDiv = document.createElement("div");
				newDiv.className="ktop";
				 if(countTda.normNum == 1){
			  	  newDiv.innerHTML = "<div class='ktbg'><span>"+countTda.xgId+"</span><br /><a href='javascript:void(0)' onclick='daglHref("+countTda.xgId+")'><div style='position: relative; width: 62px; height: 36px;'><img src='../img/xz5.png' width='62' height='36' /><span style='position: absolute; top: 10px; left: 10px;'>"+countTda.countNum+"</span></div></a></div>";
			    }else if(countTda.normNum == 2){
			  	  newDiv.innerHTML = "<div class='ktbg'><span>"+countTda.xgId+"</span><br /><a href='javascript:void(0)' onclick='daglHref("+countTda.xgId+")'><div style='position: relative; width: 62px; height: 36px;'><img src='../img/xz4.png' width='62' height='36' /><span style='position: absolute; top: 10px; left: 10px;'>"+countTda.countNum+"</span></div></a></div>";
			    }else if(countTda.normNum == 3){
			  	  newDiv.innerHTML = "<div class='ktbg'><span>"+countTda.xgId+"</span><br/><a href='javascript:void(0)' onclick='daglHref("+countTda.xgId+")'><div style='position: relative; width: 62px; height: 36px;'><img src='../img/xz3.png' width='62' height='36' /><span style='position: absolute; top: 10px; left: 10px;'>"+countTda.countNum+"</span></div></a></div>";
			    }else if(countTda.normNum == 4){
			  	  newDiv.innerHTML = "<div class='ktbg'><span>"+countTda.xgId+"</span><br/><a href='javascript:void(0)' onclick='daglHref("+countTda.xgId+")'><div style='position: relative; width: 62px; height: 36px;'><img src='../img/xz2.png' width='62' height='36' /><span style='position: absolute; top: 10px; left: 10px;'>"+countTda.countNum+"</span></div></a></div>";
			    }else if(countTda.normNum == 5){
			  	  newDiv.innerHTML = "<div class='ktbg'><span>"+countTda.xgId+"</span><br/><a href='javascript:void(0)' onclick='daglHref1()'><div style='position: relative; width: 62px; height: 36px;'><img src='../img/xz1.png' width='62' height='36' /><span style='position: absolute; top: 10px; left: 10px;'>"+countTda.countNum+"</span></div></a></div>";
			    }
				if(j == 13){
					j = 0;
					newDiv.innerHTML="<div style='clear:both'></div>";
				}
				document.getElementById("admin_dagl1_div").appendChild(newDiv);
			    j++;
			});
			}
		});
	}
}
function admin_dagl_cleanSearch() {
	admin_dagl_searchForm.find('input').val('');
	admin_dagl_search();
}
</script>
<body id="admin_dagl_layout"  class="easyui-layout" >
	<div region="north" title="档案信息调阅" iconCls="icon-search"  style="height: 60px; background:#09c;">
		<div style="margin: center; margin-left: 200px;">
		<form id="admin_dagl_searchForm">
			<label>库房编号:&nbsp</label><input type="text" name="numberID" id="numberID" style="width:150px;" />
			<input type="hidden" name="page" id="page" />
			<a href='javascript:void(0);' id="admin_dagl_searchButton" class='easyui-linkbutton' data-options="iconCls:'icon-search'">查询</a>
			<a href='javascript:void(0);' id="admin_dagl_CleanSearchButton" class='easyui-linkbutton' data-options="iconCls:'icon-cancel'">清空</a>
		</form>
		</div>
	</div>
	<div region="center" border="false"  fit="true" style="background:#09c; font-family:'宋体'; font-size:12px; color:#fff;" >
	<div class="admin_dagl_page">
		<div class="text">
		<div class="kuang" id="admin_dagl1_div">
		<div style="clear:both"></div>
		</div>
		<div style="clear:both"></div>
		</div>
	<a class="prev" href="javascript:void(0)" onclick="admin_dagl_search(2)"></a>
    <a class="next" href="javascript:void(0)" onclick="admin_dagl_search(1)"></a>
    </div>
	</div>
	<div region="south"  style="height: 20px; overflow: hidden;">
		<table id="admin_dagl_hj_datagrid">
		</table>
	</div>
<script>
/*鼠标移过，左右按钮显示*/
$(".admin_dagl_page").hover(function(){
	$(this).find(".prev,.next").fadeTo("show",0.1);
},function(){
	$(this).find(".prev,.next").hide();
})
/*鼠标移过某个按钮 高亮显示*/
$(".prev,.next").hover(function(){
	$(this).fadeTo("show",0.7);
},function(){
	$(this).fadeTo("show",0.1);
})
</script>
</body>
</html>